package cn.com.infohold.smartcity.activity.Fabaofang;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import cn.com.infohold.smartcity.R;
import cn.com.infohold.smartcity.api.bean.FaBaoFangBean;
import cn.com.infohold.smartcity.parent.ParentActivity;
import common.annotation.ViewInject;

/**
 * Created by Monsoon on 2017/11/8.
 */
public class FaBaoFangDetail_Activity extends ParentActivity{

    @ViewInject(R.id.ib_back)
    ImageButton ib_back;

    @ViewInject(R.id.tv_code)
    TextView tv_code;
    @ViewInject(R.id.tv_shortname)
    TextView tv_shortname;
    @ViewInject(R.id.tv_fullname)
    TextView tv_fullname;
    @ViewInject(R.id.tv_parentpartname)
    TextView tv_parentpartname;
    @ViewInject(R.id.tv_wheelman)
    TextView tv_wheelman;
    @ViewInject(R.id.tv_address)
    TextView tv_address;
    @ViewInject(R.id.tv_tel)
    TextView tv_tel;
    @ViewInject(R.id.tv_zipcode)
    TextView tv_zipcode;

    private FaBaoFangBean faBaoFangBean;

    @Override
    protected Object inflateView() {
        return R.layout.activity_fabaofang_detail;
    }

    @Override
    protected void initView(View anchor) {

        Intent intent = getIntent();
        Bundle land_bundle = intent.getBundleExtra("fb_bundle");
        if (land_bundle != null){
            faBaoFangBean = (FaBaoFangBean) land_bundle.getSerializable("fb_detail");
            if (faBaoFangBean != null){
                tv_code.setText(faBaoFangBean.getCode());
                tv_shortname.setText(faBaoFangBean.getShortname());
                tv_fullname.setText(faBaoFangBean.getFullname());
                tv_parentpartname.setText(faBaoFangBean.getParentpartname());
                tv_wheelman.setText(faBaoFangBean.getWheelman());
                tv_address.setText(faBaoFangBean.getAddress());
                tv_tel.setText(faBaoFangBean.getTel());
                tv_zipcode.setText(faBaoFangBean.getZipcode());

            }
        }

        ib_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
                overridePendingTransitionFade();
            }
        });
    }

}
